home *** CD-ROM | disk | FTP | other *** search
/ Isometric Game Programming with DirectX 7.0 / Isometric Game Programming.iso / directx / dxf / samples / multimedia / common / include / diutil.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-04  |  1.4 KB  |  47 lines

  1. //-----------------------------------------------------------------------------
  2. // File: DIUtil.h
  3. //
  4. // Desc: DirectInput support using action mapping
  5. //
  6. // Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
  7. //-----------------------------------------------------------------------------
  8. #ifndef DIUTIL_H
  9. #define DIUTIL_H
  10. #include <dinput.h>
  11.  
  12.  
  13.  
  14.  
  15. //-----------------------------------------------------------------------------
  16. // Name: class CInputDeviceManager
  17. // Desc: Input device manager using DX8 action mapping
  18. //-----------------------------------------------------------------------------
  19. class CInputDeviceManager
  20. {
  21.     HWND                 m_hWnd;
  22.     TCHAR*               m_strUserName;
  23.  
  24.     LPDIRECTINPUT8       m_pDI;
  25.     LPDIRECTINPUTDEVICE8 m_pdidDevices[20];
  26.     DWORD                m_dwNumDevices;
  27.     DIACTIONFORMAT       m_diaf;
  28.  
  29. public:
  30.     // Device control
  31.     HRESULT AddDevice( const DIDEVICEINSTANCE* pdidi, LPDIRECTINPUTDEVICE8 pdidDevice );
  32.     HRESULT GetDevices( LPDIRECTINPUTDEVICE8** ppDevices, DWORD* pdwNumDevices );
  33.     HRESULT ConfigureDevices( HWND hWnd, IUnknown* pSurface, VOID* pCallback, DWORD dwFlags );
  34.     VOID UnacquireDevices();
  35.  
  36.     // Construction
  37.     HRESULT SetActionFormat( DIACTIONFORMAT& diaf, BOOL bReenumerate );
  38.     HRESULT Create( HWND hWnd, TCHAR* strUserName, DIACTIONFORMAT& diaf );
  39.  
  40.     CInputDeviceManager();
  41.     ~CInputDeviceManager();
  42. };
  43.  
  44. #endif
  45.  
  46.  
  47.